import { GridContent } from '@ant-design/pro-components';
import { Col, Row } from 'antd';
import type { FC } from 'react';
import {Suspense,} from 'react';

import type { AnalysisData } from './data.d';
import CollectInterface from "@/components/CollectInterface";
import TotalApplyNum from "@/components/TotalApplyNum";
import HeadColums from "@/components/HeadColums";
import {useModel} from "@umijs/max";
import UserHeadColums from "@/components/UserHeadColums";
type AnalysisProps = {
  dashboardAndanalysis: AnalysisData;
  loading: boolean;
};

const Analysis: FC<AnalysisProps> = () => {
  const { initialState } = useModel('@@initialState');

  return (
      initialState.loginUser.userRole==="admin"?(
    <GridContent>
      <>
        <Suspense>
          <HeadColums  />
        </Suspense>

        <Suspense >

        </Suspense>

        <Row
          gutter={24}
          style={{
            marginTop: 24,
          }}
        >
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <Suspense fallback={null}>
              <TotalApplyNum />
            </Suspense>
          </Col>
          <Col xl={12} lg={24} md={24} sm={24} xs={24}>
            <Suspense>
            <CollectInterface/>
            </Suspense>
          </Col>
        </Row>

        <Suspense fallback={null}>

        </Suspense>
      </>
    </GridContent>):(<GridContent>
          <>
            <Suspense>
              <UserHeadColums  />
            </Suspense>

            <Suspense >
              <CollectInterface />
            </Suspense>

            <Row
                gutter={24}
                style={{
                  marginTop: 24,
                }}
            >
              <Col xl={12} lg={24} md={24} sm={24} xs={24}>
                <Suspense fallback={null}>
                </Suspense>
              </Col>
              <Col xl={12} lg={24} md={24} sm={24} xs={24}>
              </Col>
            </Row>

            <Suspense fallback={null}>

            </Suspense>
          </>
        </GridContent>)
  );
};
export default Analysis;
